package com.lyc.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lyc.common.serializer.Date2LongSerialize;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by 廖师兄
 * 2017-05-23 14:16
 */
@Entity
@Data
@DynamicUpdate
public class BookInfo {
    @Id
    private String bookId;

    @JsonIgnore
    private String bookOutId;

    private String bookName;
    private String bookAuthor;
    private String bookImage;
    private String bookDescription;
    private String bookDownloadUrl;

    @JsonSerialize(using = Date2LongSerialize.class)
    private Date publishTime;

    private Integer categoryId;

    @Transient
    private String categoryName;

    private Integer bookReadCount;

    private Integer bookCollectCount;
}
